//part1:C03:ex3.5.2.cpp -- input some characters, then concat them to one.
// then split with space.
#include <iostream>
#include <string>

int main(void)
{
    using namespace std;
    char tocontinue1 = 'y';
    string s, result;
    while (cin >> s)
    {
        if (!result.size())
        {
            result += s;
        }
        else
        {
            result = result + " " + s;
        }
        cout << "to continue? (y or n)?\n";
        cin >> tocontinue1;
        if (tocontinue1 == 'y' || tocontinue1 == 'Y')
        {
            cout << "Enter next string:\n";
        }
        else
        {
            break;
        }
    }
    cout << "new string is: " << result << endl;

    return 0;
}
